package com.syty.demo.config;

import com.syty.demo.Listener.LoginSessionListener;
import io.swagger.annotations.Api;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Api("spring-核心配置文件")
@Configuration
@Import({ShiroConfig.class,SwaggerConfig.class})
public class SpringConfig {

    //监听器
    @Bean
    public ServletListenerRegistrationBean<LoginSessionListener> servletListenerRegistrationBean() {
        ServletListenerRegistrationBean<LoginSessionListener> registrationBean =
                new ServletListenerRegistrationBean<>();
        registrationBean.setListener(new LoginSessionListener());
        return registrationBean;
    }
}
